#!/bin/sh
# postinst script for the BornAgain library
# creates symbolic links for the library files in the PYTHONPATH

set -e

# creating link to BornAgain gui in bin directory
echo "------------ POSTINSTALL OPERATIONS... ------------"
COMMAND="ln -sf @CMAKE_INSTALL_PREFIX@/lib/@destination_suffix@/exec/BornAgain @CMAKE_INSTALL_PREFIX@/bin/bornagain"
echo ${COMMAND}
${COMMAND}

# creating links for python

for item_to_link in bornagain libBornAgainCore.py _libBornAgainCore.so libBornAgainFit.py _libBornAgainFit.so _libBornAgainGUI.so
do
 COMMAND="ln -sf @CMAKE_INSTALL_PREFIX@/lib/@destination_suffix@/${item_to_link} @Python_SITELIB@/"
 echo ${COMMAND}
 ${COMMAND}
done
